<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
      1. ++i<5(1<5) console.log(1)
      2. ++i<5(2<5) console.log(2)
      3. ++i<5(3<5) console.log(3)
      ...
      3. ++i<5(5<5)
      */
      let i = 0;
      // while (++i < 5) console.log(i);
      /*
      1. i++<5(0<5) console.log(1)
      2. i++<5(1<5) console.log(2)
      ...
      3. i++<5(3<5) console.log(4)
      4. i++<5(4<5) console.log(5)
      */
      while (i++ < 5) console.log(i);
    </script>
  </body>
</html>
